/*
 * memory.c
 *
 * Funcoes para gerenciamento e manipulacao de memoria
 *
 *  Created on: 09/09/2010
 *      Author: Wendell
 */

#include <memory.h>

void *memcpy(void *dest, const void *src, int count) {
	const char *sp = (const char *)src;
	char *dp = (char *)dest;
	for(; count != 0; count--) {
		*dp++ = *sp++;
	}
	return dest;
}

void *memset(void *dest, char val, int count) {
	char *temp = (char *)dest;
	for( ; count != 0; count--) {
		*temp++ = val;
	}
	return dest;
}

unsigned short *memsetw(unsigned short *dest, unsigned short val, int count) {
	unsigned short *temp = (unsigned short *)dest;
	for( ; count != 0; count--) {
		*temp++ = val;
	}
	return dest;
}
//******************* Implementar malloc...




